-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Introduce consolidated 5-phase PR agent workflow with try-fix skill #33398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: PureWeen <[email protected]>
Co-authored-by: PureWeen <[email protected]>
|
@copilot update the title and description to be more accurate describing the purpose of this PR It's fine to not reference the original PureWeen PR |
Updated the PR description to be standalone and more accurately describe the purpose: introduces a consolidated 7-phase PR agent workflow, new skills for test verification and test writing, new instruction files for agent/skill development, and script enhancements. Note: I can only update the PR description, not the title. Please update the title to something like "Introduce consolidated 7-phase PR agent workflow" or similar. |
| **If starting from a PR:** | ||
| ```bash | ||
| # Checkout the PR | ||
| git fetch origin pull/XXXXX/head:pr-XXXXX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future - we should keep in mind that when an agent switches branches, it may not have access to the latest agent skills or helper files available from the branch the review has been started
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine for now. This is just a weird state where it doesn't exist on main so it has issues. For cases where we start iterating on the agent after merge this won't really be a problem anymore. Like if you are fixing the agent with a PR review you'd just fix the agent while working on that PR then probably create a separate PR with agent fixes.
| 3. **Push and create PR**: | ||
| ```bash | ||
| git push -u origin fix/issue-XXXXX | ||
| gh pr create --title "Fix #XXXXX: [Title]" --body "Fixes #XXXXX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or if automatic PR creation is intended then can we title it "[PR-agent] Fix #XXXXX: [Title]"?
| @@ -0,0 +1,202 @@ | |||
| --- | |||
| name: write-tests | |||
| description: Creates UI tests for a GitHub issue and verifies they reproduce the bug. Iterates until tests actually fail (proving they catch the issue). Use when PR lacks tests or tests need to be created for an issue. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This skill is meant to create a UI test. Shouldn’t it apply to both UI and unit tests and decide which one is more appropriate before creating either?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, it should be both but for version one here and to not just keep iterating endlessly :-) I just have it writing UItests for now
And then once this is merged in someone ;-) can work on improving this skill independently
- Add try-fix skill for iterative fix exploration (generic, not agent-specific) - Reduce from 7 phases to 5: Pre-Flight, Tests, Gate, Fix, Report - Remove Validate phase (merged into Fix) - Replace Analysis/Compare/Regression with try-fix loop - Fix phase loops try-fix skill (max 5 candidates) to explore alternatives - Add Fix Candidates table to state file template - PR's fix becomes Candidate #1, alternatives explored automatically - Add user confirmation before PR creation - Update copilot-instructions.md with new agent description
3f6375a to
9c09f96
Compare
63e8be1 to
faeba21
Compare
|
PR title and description might need some changes as it went from 7 to 5 phases |
|
@copilot can you fix the title and description to represent all the latest changes |
Updated the PR description to reflect the current state:
For the title, I'd suggest: "Introduce consolidated 5-phase PR agent workflow with try-fix skill" - I cannot modify the title directly. |
- Replace 'Issue Resolver Agent' and 'PR Reviewer Agent' with unified 'PR Agent' - Update phase count from 7 to 5 (Pre-Flight, Tests, Gate, Fix, Report) - Add agents/pr/post-gate.md to agent files list - Add Skills section documenting try-fix, verify-tests-fail-without-fix, write-tests, pr-build-status - Add missing instruction files (agents, skills, helix-device-tests) - Update metrics and last updated date to 2026-01-07 - Remove reference to non-existent agents/README.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a major consolidation of the agent workflow, replacing two separate agents (issue-resolver and pr-reviewer) with a unified 5-phase pr agent that provides structured, end-to-end assistance for investigating issues and working on pull requests.
Key Changes
- Unified PR Agent: Introduces a sequential 5-phase workflow (Pre-Flight → Tests → Gate → Fix → Report) tracked in state files
- try-fix Skill: New skill for exploring independent fix approaches with empirical testing and failure analysis
- Skills Framework: Adds reusable skills (
write-tests,verify-tests-fail-without-fix,try-fix) that agents can invoke - Enhanced Testing: Scripts now support
-Rebuildparameter for clean builds during test verification
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
.github/agents/pr.md |
Main PR agent covering phases 1-3 (Pre-Flight, Tests, Gate) with comprehensive workflow instructions |
.github/agents/pr/post-gate.md |
Phases 4-5 (Fix, Report) including try-fix orchestration and final recommendations |
.github/agents/pr-reviewer.md |
Removed - functionality consolidated into pr agent |
.github/agents/issue-resolver.md |
Removed - functionality consolidated into pr agent |
.github/agents/uitest-coding-agent.md |
Updated to reference pr agent instead of deprecated agents |
.github/skills/try-fix/SKILL.md |
New skill for proposing and testing independent fix approaches with learning from failures |
.github/skills/write-tests/SKILL.md |
New skill for creating UI tests following MAUI conventions with verification |
.github/skills/verify-tests-fail-without-fix/SKILL.md |
New skill documentation for test verification |
.github/skills/verify-tests-fail-without-fix/scripts/verify-tests-fail.ps1 |
Auto-detects mode based on git diff, verifies tests FAIL without fix and PASS with fix |
.github/instructions/agents.instructions.md |
New guidelines for authoring custom agents (constraints, best practices, anti-patterns) |
.github/instructions/skills.instructions.md |
New standards for skill development (structure, naming, script organization) |
.github/instructions/sandbox.instructions.md |
Updated references from deprecated agents to pr agent |
.github/instructions/collectionview-handler-detection.instructions.md |
Expanded with platform-specific guidance clarifying Items/ vs Items2/ usage |
.github/scripts/BuildAndRunHostApp.ps1 |
Added -Rebuild switch parameter for clean builds |
.github/scripts/shared/Build-AndDeploy.ps1 |
Added -Rebuild switch that passes --no-incremental to dotnet build |
.github/copilot-instructions.md |
Updated agent list and delegation examples to reference pr agent |
.github/README-AI.md |
Comprehensive update reflecting new agent structure and skills framework |
| ```bash | ||
| # Identify the PR's fix files from the state file "Files Changed" section | ||
| # Revert ALL fix files (not test files) | ||
| git checkout HEAD~1 -- src/path/to/fix1.cs src/path/to/fix2.cs |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The git command git checkout HEAD~1 -- src/path/to/fix1.cs will revert the file to the commit before HEAD, not to the base branch. This could cause issues if:
- The PR has multiple commits with changes to the same file
- The file was changed in commits other than the most recent one
The script should use the base branch (which is detected/provided) instead of HEAD~1. Consider using the $BaseBranch variable that's mentioned in the Inputs section (line 41) or detecting it from the state file's "Files Changed" section.
| git checkout HEAD~1 -- src/path/to/fix1.cs src/path/to/fix2.cs | |
| git checkout "$BaseBranch" -- src/path/to/fix1.cs src/path/to/fix2.cs |
| - User: "Review PR #12345" → Immediately invoke **pr** agent | ||
| - User: "Test this PR" → Immediately invoke **sandbox-agent** | ||
| - User: "Fix issue #67890" → Immediately invoke **issue-resolver** agent | ||
| - User: "Fix issue #67890" (no PR exists) → Suggest using `/delegate` command |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's an inconsistency in guidance for handling "fix issue" requests when no PR exists:
- Line 210 in copilot-instructions.md says: "Fix issue #67890 (no PR exists) → Suggest using
/delegatecommand" - Line 167 in sandbox.instructions.md says: "fix issue #XXXXX (no PR exists) → Suggest
/delegatecommand"
However, the pr agent description (line 187 in copilot-instructions.md) says:
"Use when: A PR already exists and needs review or work, OR an issue needs a fix"
And the pr agent trigger phrases include "fix issue #XXXXX" (line 189).
This creates confusion: Should "fix issue" delegate to the pr agent, or suggest the /delegate command? The delegation policy (line 205) says to "ALWAYS delegate to the appropriate agent immediately" when trigger phrases match, but the examples contradict this.
Recommendation: Either the pr agent should handle "fix issue" for issues without PRs, OR the trigger phrases should clarify it only applies when a PR exists. The examples should align with the actual behavior.
| - User: "Fix issue #67890" (no PR exists) → Suggest using `/delegate` command | |
| - User: "Fix issue #67890" (no PR exists) → Immediately invoke **pr** agent |
- Replace non-existent appium-control.instructions.md with uitests.instructions.md - Fix UI tests workflow path from .github/workflows/ to eng/pipelines/
…otnet#33398) Introduces a consolidated 5-phase PR agent workflow that provides structured, end-to-end assistance for investigating issues, developing fixes, and creating pull requests. ### PR Agent Workflow The new `pr` agent replaces the separate `issue-resolver` and `pr-reviewer` agents with a unified 5-phase workflow: 1. **Pre-Flight** - Context gathering and state file creation 2. **Tests** - Create or verify reproduction tests using the `write-tests` skill 3. **Gate** - Verify tests catch the issue (mandatory checkpoint before proceeding) 4. **Fix** - Explore and test fix approaches using the `try-fix` skill 5. **Report** - Present findings and create PR (with explicit user confirmation) ### Agent Changes - **Removed**: `issue-resolver.md`, `pr-reviewer.md` - **Added**: `pr.md` - Main agent with phases 1-3 (Pre-Flight, Tests, Gate) - **Added**: `pr/post-gate.md` - Phases 4-5 (Fix, Report) ### New Skills - `try-fix/` - Proposes ONE independent fix approach per invocation, applies it, runs tests, records result with failure analysis, then reverts. Learns from prior attempts. Max 5 attempts per session. - `verify-tests-fail-without-fix/` - Auto-detects fix files from git diff, verifies tests FAIL without fix and PASS with fix - `write-tests/` - Creates UI test pages and NUnit tests following MAUI conventions, with verification that tests reproduce the bug ### New Instructions - `agents.instructions.md` - Copilot CLI agent authoring guidelines (constraints, best practices, anti-patterns) - `skills.instructions.md` - Skill development standards (structure, naming, script organization) ### Script Updates - Added `-Rebuild` parameter to `BuildAndRunHostApp.ps1` and `Build-AndDeploy.ps1` for clean builds during test verification ### Documentation Updates - Updated references from `issue-resolver`/`pr-reviewer` to `pr` agent across README-AI.md, copilot-instructions.md, sandbox.instructions.md, uitest-coding-agent.md - Expanded `collectionview-handler-detection.instructions.md` with platform-specific guidance (Items2/ is iOS/MacCatalyst only, Items/ is the only Android/Windows implementation) <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > Create a PR with all the changes from this PR on the PureWeen fork PureWeen#9 </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: PureWeen <[email protected]> Co-authored-by: Shane Neuville <[email protected]>
Introduces a consolidated 5-phase PR agent workflow that provides structured, end-to-end assistance for investigating issues, developing fixes, and creating pull requests.
PR Agent Workflow
The new
pragent replaces the separateissue-resolverandpr-revieweragents with a unified 5-phase workflow:write-testsskilltry-fixskillAgent Changes
issue-resolver.md,pr-reviewer.mdpr.md- Main agent with phases 1-3 (Pre-Flight, Tests, Gate)pr/post-gate.md- Phases 4-5 (Fix, Report)New Skills
try-fix/- Proposes ONE independent fix approach per invocation, applies it, runs tests, records result with failure analysis, then reverts. Learns from prior attempts. Max 5 attempts per session.verify-tests-fail-without-fix/- Auto-detects fix files from git diff, verifies tests FAIL without fix and PASS with fixwrite-tests/- Creates UI test pages and NUnit tests following MAUI conventions, with verification that tests reproduce the bugNew Instructions
agents.instructions.md- Copilot CLI agent authoring guidelines (constraints, best practices, anti-patterns)skills.instructions.md- Skill development standards (structure, naming, script organization)Script Updates
-Rebuildparameter toBuildAndRunHostApp.ps1andBuild-AndDeploy.ps1for clean builds during test verificationDocumentation Updates
issue-resolver/pr-reviewertopragent across README-AI.md, copilot-instructions.md, sandbox.instructions.md, uitest-coding-agent.mdcollectionview-handler-detection.instructions.mdwith platform-specific guidance (Items2/ is iOS/MacCatalyst only, Items/ is the only Android/Windows implementation)Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.